home *** CD-ROM | disk | FTP | other *** search
- global gCPU, CHIMEnotes, gObjects, gAnimationObjects, myMidiDevice, outDevName, OutDevNumsList, hotCursorlist, gLimitPreLoad
-
- on pushButton2 Action, holdDown
- set theClickOn to the clickOn
- cursor([the number of cast "Pointcursor", the number of cast "Pointcursor.mask"])
- set thisButton to the castNum of sprite theClickOn
- updateStage()
- repeat while the stillDown
- if rollOver(theClickOn) then
- set the castNum of sprite theClickOn to the number of cast thisButton + 1
- updateStage()
- next repeat
- end if
- set the castNum of sprite theClickOn to thisButton
- updateStage()
- end repeat
- if voidp(holdDown) then
- set the castNum of sprite theClickOn to thisButton
- end if
- updateStage()
- if rollOver(theClickOn) then
- doAction(Action, thisButton, holdDown)
- end if
- end
-
- on doAction Action, thisButton, holdDown
- if not voidp(holdDown) then
- set Action to string(Action && thisButton)
- end if
- do(string(Action))
- end
-
- on doCheckClick
- if the hilite of cast "Turbo checkBox" then
- set gLimitPreLoad to 1
- else
- set gLimitPreLoad to 0
- end if
- end
-
- on playNotes thisButton
- if objectp(windowsMIDIXObj) then
- cursor([the number of cast "NullCursor", the number of cast "NullCursor.mask"])
- set gObjects to [#CHIME: [#Children: [#CHIMEmonitor, #Flake1, #Flake2, #Flake3, #Flake4], #ChildStates: [1, 1, 1, 1], #DisplayState: #false, #Monitor: #CHIMEmonitor, #PlugInMixer: #true, #RefName: #CHIME, #solved: 0, #SpriteNum: 50, #State: #nonChaotic, #type: #Parent]]
- set gAnimationObjects to [:]
- set lastNoteTime to the ticks - 10
- set INTRument to #CHIME
- set stopTime to the timer + (2 * 60)
- repeat while the timer < stopTime
- if the ticks < (lastNoteTime + 5) then
- next repeat
- end if
- set note to getRandomNote(DRUM, 3, 8)
- if note > 0 then
- if note > 127 then
- set note to note / 2
- end if
- noteOn(INTRument, note, 127)
- set duration to the ticks + random(30)
- repeat while the ticks < duration
- CursorandUpdate()
- end repeat
- noteOff(INTRument, note)
- set lastNoteTime to the ticks
- end if
- end repeat
- end if
- set the castNum of sprite 2 to thisButton
- end
-
- on setMidiConfig
- if voidp(myMidiDevice) then
- set myMidiDevice to 1
- end if
- if not myMidiDevice > 0 then
- set myMidiDevice to 1
- end if
- settingMidiDrv(myMidiDevice)
- end
-
- on setTurboConfig
- if voidp(gLimitPreLoad) then
- set the hilite of cast "Turbo checkBox" to 1
- set gLimitPreLoad to 0
- else
- set the hilite of cast "Turbo checkBox" to not gLimitPreLoad
- end if
- end
-
- on settingMidiDrv direction
- global thisSetting
- if voidp(thisSetting) then
- set thisSetting to 0
- end if
- set minSetting to 1
- if not voidp(OutDevNumsList) then
- set maxSetting to min(count(OutDevNumsList), 9)
- end if
- if maxSetting = 0 then
- set the castNum of sprite 3 to the number of cast "miditestPrev.dim"
- set the castNum of sprite 4 to the number of cast "miditestnext.dim"
- set the text of field "miditext" to "No Available MIDI Device Drivers."
- updateStage()
- exit
- end if
- if objectp(windowsMIDIXObj) then
- if windowsMIDIXObj(mCloseOut) then
- alert("Error closing device - Unable to open this device")
- end if
- end if
- set thisSetting to thisSetting + direction
- if thisSetting <= minSetting then
- set thisSetting to minSetting
- set the castNum of sprite 3 to the number of cast "miditestPrev.dim"
- else
- if thisSetting >= maxSetting then
- set thisSetting to maxSetting
- set the castNum of sprite 4 to the number of cast "miditestnext.dim"
- else
- set the castNum of sprite 3 to the number of cast "miditestPrev.up"
- set the castNum of sprite 4 to the number of cast "miditestnext.up"
- end if
- end if
- set myMidiDevice to thisSetting
- if objectp(windowsMIDIXObj) then
- set outDevID to getAt(OutDevNumsList, myMidiDevice)
- set outDevName to windowsMIDIXObj(mGetDevName, "OUT", outDevID)
- if windowsMIDIXObj(mOpenOut, outDevID, 1024) then
- if (thisSetting = minSetting) or (thisSetting = maxSetting) then
- settingMidiDrv(opposite(direction))
- else
- settingMidiDrv(direction)
- end if
- end if
- end if
- if objectp(windowsMIDIXObj) then
- set the text of field "miditext" to "#" & myMidiDevice && "-" && outDevName
- else
- set the text of field "miditext" to "No Available MIDI Device Drivers."
- end if
- updateStage()
- end
-
- on opposite direction
- if direction then
- set direction to 0
- else
- set direction to 1
- end if
- return direction
- end
-
- on saveMidiSettings
- global saveResult
- set saveResult to savePrefData()
- end
-
- on continueGame
- cursor([the number of cast "NullCursor", the number of cast "NullCursor.mask"])
- go("loadgameNow")
- end
-
- on saveMidiAndContinueGame
- puppetbuttons(0)
- saveMidiSettings()
- continueGame()
- end
-
- on CheckRollOver
- if getOne(hotCursorlist, rollTest()) > 0 then
- cursor([the number of cast "Pointcursor", the number of cast "Pointcursor.mask"])
- updateStage()
- else
- cursor([the number of cast "NullCursor", the number of cast "NullCursor.mask"])
- updateStage()
- end if
- end
-
- on rollTest
- repeat with thisSprite in hotCursorlist
- if rollOver(thisSprite) then
- if the castNum of sprite thisSprite > 0 then
- return thisSprite
- next repeat
- end if
- return 48
- end if
- end repeat
- end
-
- on initconfigFrame
- global hotCursorlist
- set hotCursorlist to [2, 3, 4, 5, 6]
- end
-
- on puppetbuttons flag
- global hotCursorlist
- repeat with thisSprite in hotCursorlist
- puppetSprite(thisSprite, flag)
- end repeat
- end
-